package com.sino.androiddesign.customView

import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.support.v4.app.Fragment
import com.sino.androiddesign.R
import kotlinx.android.synthetic.main.activity_custom_view.*

//参考地址 https://blog.csdn.net/aigestudio/article/details/41212583
// 新的参考地址 https://blog.csdn.net/harvic880925/article/details/50995268
class CustomViewActivity : AppCompatActivity() {
    private val TAG = "CustomViewActivity"

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_custom_view)

        initView()
    }

    private fun initView() {

        val fragList: ArrayList<Fragment> = ArrayList()
        val strList: ArrayList<String> = ArrayList()
        fragList.add(PathFragment())
        strList.add("路径Path")
        fragList.add(TextFragment())
        strList.add("文字Text")
        fragList.add(RegionFragment())
        strList.add("区域Region")
        fragList.add(CanvasFragment())
        strList.add("画布变换与操作")
        fragList.add(Demo1PieFragment())
        strList.add("圆饼图")
        fragList.add(Demo2CanvasBase())
        strList.add("画布的基本操作")
        fragList.add(Demo3CanvasBitmapTextFragment())
        strList.add("画布之图片文字")
        fragList.add(Demo4PathFragment())
        strList.add("自定义view之Path")
        fragList.add(Demo5BezierCurveFragment())
        strList.add("自定义view之贝塞尔曲线")



        cv_vp.adapter = PageAdapter(supportFragmentManager,this,fragList,strList)

        cv_tab.setupWithViewPager(cv_vp)

        cv_vp.offscreenPageLimit = fragList.size-1
    }


}
